package com.andyage.admin.action;

import java.io.IOException;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONObject;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;


import com.andyage.admin.service.IAdteUserService;
import com.andyage.admin.bean.AdteuserBean;

/**
 * 前端用户请求
 * 
 * @author john
 * 
 */
@Controller
public class AdteUserAction {
	@Resource
	private IAdteUserService iadteUserService;
	/**
	 * 后端功能，管理所有前端用户
	 * @param userBean
	 * @param response
	 */
	@RequestMapping("/queryAllUserByCondition")
	public void queryAllUserByCondition(AdteuserBean userBean,HttpServletRequest request,
			HttpServletResponse response) {
		try {
			iadteUserService.queryAllAdteuserByCondition(userBean,request,response);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
			
		}
	/**
	 * 修改用户信息，公共功能
	 * @param userBean
	 * @param response
	 */
	@RequestMapping("/updateUserByUserId")
	public void updateUserByUser(HttpServletRequest request,HttpServletResponse response) {
	try {
		iadteUserService.updateAdteUserByUser(request,response);
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	}
	@RequestMapping("/insertAdteUser")
	public void insertAdteUser(HttpServletRequest request,HttpServletResponse response) {
		// TODO Auto-generated method stub
		try {
			iadteUserService.insertAdteUser(request, response);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	@RequestMapping("/querytuAccountByTel")
	public void querytuAccountByTel(HttpServletRequest request,HttpServletResponse response) {
		try {
			iadteUserService.querytuAccountByTel(request, response);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	/**
	 * 删除用户，慎用！
	 * @param request
	 * @param response
	 */
	/*@RequestMapping("/deleteUserById")
	public void deleteUserById(HttpServletRequest request,HttpServletResponse response) {
		 try {
			iadteUserService.deleteAdteuserById(request,response);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}*/
}
